#!/usr/bin/env bash
set -euo pipefail

cd "$(dirname "${0}")/../.."
APP_ROOT=$(pwd)

function main() {
	cd ${APP_ROOT}
	mkdir -p dist/static/node_modules
	dependencies=(vscode-textmate vscode-oniguruma xterm xterm-addon-search xterm-addon-unicode11 xterm-addon-webgl tas-client-umd iconv-lite-umd jschardet)

	for dependency in ${dependencies[@]};
	do
		rsync -a --del lib/vscode/node_modules/${dependency} dist/static/node_modules
	done

	echo "copy necessary node_modules done!"
}

main "$@"
